/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('mhub', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CreateAppRequest {
  bundleId?: string(name='BundleId', example='com.test.ios'),
  encodedIcon?: string(name='EncodedIcon'),
  industryId?: string(name='IndustryId', example='1'),
  name?: string(name='Name', description='This parameter is required.'),
  packageName?: string(name='PackageName', example='com.test.android'),
  productId?: string(name='ProductId', description='This parameter is required.', example='123456'),
  type?: int32(name='Type', example='1'),
}

model CreateAppResponseBody = {
  appInfo?: {
    appKey?: string(name='AppKey', example='123456'),
    bundleId?: string(name='BundleId', example='com.test.ios'),
    createTime?: string(name='CreateTime', example='2020-12-16T06:25:52Z'),
    description?: string(name='Description'),
    modifyTime?: string(name='ModifyTime', example='2020-12-16T06:25:52Z'),
    name?: string(name='Name'),
    packageName?: string(name='PackageName', example='com.test.android'),
    productId?: int32(name='ProductId', example='123456'),
    type?: int32(name='Type', example='1'),
  }(name='AppInfo'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929****'),
}

model CreateAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppResponseBody(name='body'),
}

/**
 * @param request CreateAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAppResponse
 */
async function createAppWithOptions(request: CreateAppRequest, runtime: Util.RuntimeOptions): CreateAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bundleId)) {
    query['BundleId'] = request.bundleId;
  }
  if (!Util.isUnset(request.encodedIcon)) {
    query['EncodedIcon'] = request.encodedIcon;
  }
  if (!Util.isUnset(request.industryId)) {
    query['IndustryId'] = request.industryId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.packageName)) {
    query['PackageName'] = request.packageName;
  }
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApp',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateAppRequest
 * @return CreateAppResponse
 */
async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppWithOptions(request, runtime);
}

model CreateProductRequest {
  description?: string(name='Description', example='AAA'),
  name?: string(name='Name', description='This parameter is required.'),
}

model CreateProductResponseBody = {
  productId?: long(name='ProductId', example='123456'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model CreateProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProductResponseBody(name='body'),
}

/**
 * @param request CreateProductRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProductResponse
 */
async function createProductWithOptions(request: CreateProductRequest, runtime: Util.RuntimeOptions): CreateProductResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateProduct',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateProductRequest
 * @return CreateProductResponse
 */
async function createProduct(request: CreateProductRequest): CreateProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return createProductWithOptions(request, runtime);
}

model DeleteAppRequest {
  appKey?: string(name='AppKey', description='This parameter is required.', example='123456'),
}

model DeleteAppResponseBody = {
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model DeleteAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppResponseBody(name='body'),
}

/**
 * @param request DeleteAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAppResponse
 */
async function deleteAppWithOptions(request: DeleteAppRequest, runtime: Util.RuntimeOptions): DeleteAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApp',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteAppRequest
 * @return DeleteAppResponse
 */
async function deleteApp(request: DeleteAppRequest): DeleteAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppWithOptions(request, runtime);
}

model DeleteProductRequest {
  productId?: string(name='ProductId', description='This parameter is required.', example='12345'),
}

model DeleteProductResponseBody = {
  message?: string(name='Message', example='PRODUCT_NOT_ALONE'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model DeleteProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProductResponseBody(name='body'),
}

/**
 * @param request DeleteProductRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProductResponse
 */
async function deleteProductWithOptions(request: DeleteProductRequest, runtime: Util.RuntimeOptions): DeleteProductResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProduct',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteProductRequest
 * @return DeleteProductResponse
 */
async function deleteProduct(request: DeleteProductRequest): DeleteProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteProductWithOptions(request, runtime);
}

model DescribeDashboardRequest {
  appKey?: string(name='AppKey', example='29201799'),
  appType?: int32(name='AppType', example='1'),
  appVersion?: string(name='AppVersion', example='4.8'),
  endTime?: long(name='EndTime', example='1681985390256'),
  keyword?: string(name='Keyword', example='4.8'),
  proxyAction?: string(name='ProxyAction', example='queryAppVersions'),
  serviceName?: string(name='ServiceName', example='mqc'),
  startTime?: long(name='StartTime', example='1681369984564'),
}

model DescribeDashboardResponseBody = {
  model?: string(name='Model', example='{
	"success":true,
	"model":{
		"perfMonthCount":0,
		"compatibilityMonthCount":0,
		"perfLastMonthCount":0,
		"compatibilityLastMonthCount":0,
		"automationMonthCount":0,
		"automationLastMonthCount":0
	}
}'),
  requestId?: string(name='RequestId', example='4CC30A8F-787C-55CA-87A6-7D1BED56067E'),
}

model DescribeDashboardResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDashboardResponseBody(name='body'),
}

/**
 * @summary 获取emas dashboard
 *
 * @param request DescribeDashboardRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDashboardResponse
 */
async function describeDashboardWithOptions(request: DescribeDashboardRequest, runtime: Util.RuntimeOptions): DescribeDashboardResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.appType)) {
    query['AppType'] = request.appType;
  }
  if (!Util.isUnset(request.appVersion)) {
    query['AppVersion'] = request.appVersion;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.proxyAction)) {
    query['ProxyAction'] = request.proxyAction;
  }
  if (!Util.isUnset(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDashboard',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取emas dashboard
 *
 * @param request DescribeDashboardRequest
 * @return DescribeDashboardResponse
 */
async function describeDashboard(request: DescribeDashboardRequest): DescribeDashboardResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDashboardWithOptions(request, runtime);
}

model ListAppsRequest {
  osType?: int32(name='OsType', example='1'),
  page?: string(name='Page', example='1'),
  pageSize?: string(name='PageSize', example='20'),
  productId?: string(name='ProductId', description='This parameter is required.', example='123456'),
}

model ListAppsResponseBody = {
  appInfos?: {
    appInfo?: [ 
    {
      appKey?: string(name='AppKey', example='123456'),
      bundleId?: string(name='BundleId', example='com.test.ios'),
      encodedIcon?: string(name='EncodedIcon'),
      industryId?: int32(name='IndustryId', example='1'),
      name?: string(name='Name'),
      packageName?: string(name='PackageName', example='com.test.android'),
      readonly?: boolean(name='Readonly', example='false'),
      type?: int32(name='Type', example='1'),
    }
  ](name='AppInfo')
  }(name='AppInfos'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
  total?: int32(name='Total', example='10'),
  ubsmsStatus?: string(name='UbsmsStatus', example='enabled'),
}

model ListAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAppsResponseBody(name='body'),
}

/**
 * @summary 展示用户应用列表
 *
 * @param request ListAppsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAppsResponse
 */
async function listAppsWithOptions(request: ListAppsRequest, runtime: Util.RuntimeOptions): ListAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.osType)) {
    query['OsType'] = request.osType;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListApps',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 展示用户应用列表
 *
 * @param request ListAppsRequest
 * @return ListAppsResponse
 */
async function listApps(request: ListAppsRequest): ListAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppsWithOptions(request, runtime);
}

model ListProductsRequest {
  offset?: int32(name='Offset', example='1'),
  productName?: string(name='ProductName'),
  simple?: boolean(name='Simple', example='false'),
  size?: int32(name='Size', example='20'),
}

model ListProductsResponseBody = {
  productInfos?: {
    productInfo?: [ 
    {
      createTime?: string(name='CreateTime', example='2020-12-16T06:25:52Z'),
      description?: string(name='Description', example='xxxx'),
      encodedIcon?: string(name='EncodedIcon'),
      industryId?: int32(name='IndustryId', example='1'),
      name?: string(name='Name'),
      platforms?: string(name='Platforms', example='iOS'),
      productId?: int32(name='ProductId', example='1234'),
      readonly?: boolean(name='Readonly', example='false'),
    }
  ](name='ProductInfo')
  }(name='ProductInfos'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
  total?: int32(name='Total', example='10'),
  ubsmsStatus?: string(name='UbsmsStatus', example='enabled'),
}

model ListProductsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProductsResponseBody(name='body'),
}

/**
 * @param request ListProductsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProductsResponse
 */
async function listProductsWithOptions(request: ListProductsRequest, runtime: Util.RuntimeOptions): ListProductsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.productName)) {
    query['ProductName'] = request.productName;
  }
  if (!Util.isUnset(request.simple)) {
    query['Simple'] = request.simple;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProducts',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListProductsRequest
 * @return ListProductsResponse
 */
async function listProducts(request: ListProductsRequest): ListProductsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listProductsWithOptions(request, runtime);
}

model ModifyAppRequest {
  appKey?: string(name='AppKey', description='This parameter is required.', example='123456'),
  bundleId?: string(name='BundleId', example='com.test.ios'),
  encodedIcon?: string(name='EncodedIcon'),
  industryId?: int32(name='IndustryId', example='1'),
  name?: string(name='Name'),
  packageName?: string(name='PackageName', example='com.test.android'),
}

model ModifyAppResponseBody = {
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model ModifyAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAppResponseBody(name='body'),
}

/**
 * @param request ModifyAppRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAppResponse
 */
async function modifyAppWithOptions(request: ModifyAppRequest, runtime: Util.RuntimeOptions): ModifyAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.bundleId)) {
    query['BundleId'] = request.bundleId;
  }
  if (!Util.isUnset(request.encodedIcon)) {
    query['EncodedIcon'] = request.encodedIcon;
  }
  if (!Util.isUnset(request.industryId)) {
    query['IndustryId'] = request.industryId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.packageName)) {
    query['PackageName'] = request.packageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApp',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyAppRequest
 * @return ModifyAppResponse
 */
async function modifyApp(request: ModifyAppRequest): ModifyAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAppWithOptions(request, runtime);
}

model ModifyProductRequest {
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  productId?: string(name='ProductId', description='This parameter is required.', example='1234'),
}

model ModifyProductResponseBody = {
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model ModifyProductResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyProductResponseBody(name='body'),
}

/**
 * @param request ModifyProductRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyProductResponse
 */
async function modifyProductWithOptions(request: ModifyProductRequest, runtime: Util.RuntimeOptions): ModifyProductResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyProduct',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ModifyProductRequest
 * @return ModifyProductResponse
 */
async function modifyProduct(request: ModifyProductRequest): ModifyProductResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyProductWithOptions(request, runtime);
}

model OpenEmasServiceRequest {
  ownerId?: long(name='OwnerId'),
}

model OpenEmasServiceResponseBody = {
  orderId?: string(name='OrderId', example='20671870151****'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model OpenEmasServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenEmasServiceResponseBody(name='body'),
}

/**
 * @param request OpenEmasServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenEmasServiceResponse
 */
async function openEmasServiceWithOptions(request: OpenEmasServiceRequest, runtime: Util.RuntimeOptions): OpenEmasServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OpenEmasService',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request OpenEmasServiceRequest
 * @return OpenEmasServiceResponse
 */
async function openEmasService(request: OpenEmasServiceRequest): OpenEmasServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openEmasServiceWithOptions(request, runtime);
}

model QueryAppInfoRequest {
  appKey?: string(name='AppKey', description='This parameter is required.', example='123456'),
}

model QueryAppInfoResponseBody = {
  appInfo?: {
    appKey?: string(name='AppKey', example='123456'),
    appName?: string(name='AppName'),
    bundleId?: string(name='BundleId', example='com.test.ios'),
    certDevelopAvail?: boolean(name='CertDevelopAvail', example='false'),
    certDevelopExpiration?: string(name='CertDevelopExpiration', example='2020-12-16T06:25:52Z'),
    certProductAvail?: boolean(name='CertProductAvail', example='false'),
    certProductExpiration?: string(name='CertProductExpiration', example='2020-12-16T06:25:52Z'),
    createTime?: string(name='CreateTime', example='2020-12-16T06:25:52Z'),
    encodedIcon?: string(name='EncodedIcon'),
    industryId?: int32(name='IndustryId', example='1'),
    packageName?: string(name='PackageName', example='com.test.android'),
    productId?: long(name='ProductId', example='1234'),
    readonly?: boolean(name='Readonly', example='false'),
    status?: int32(name='Status', example='0'),
    type?: int32(name='Type', example='1'),
  }(name='AppInfo'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model QueryAppInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAppInfoResponseBody(name='body'),
}

/**
 * @param request QueryAppInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAppInfoResponse
 */
async function queryAppInfoWithOptions(request: QueryAppInfoRequest, runtime: Util.RuntimeOptions): QueryAppInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAppInfo',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request QueryAppInfoRequest
 * @return QueryAppInfoResponse
 */
async function queryAppInfo(request: QueryAppInfoRequest): QueryAppInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAppInfoWithOptions(request, runtime);
}

model QueryAppSecurityInfoRequest {
  appKey?: string(name='AppKey', description='This parameter is required.', example='123456'),
}

model QueryAppSecurityInfoResponseBody = {
  appSecurityInfo?: {
    appKey?: string(name='AppKey', example='123456'),
    appSecret?: string(name='AppSecret', example='abc123abc123'),
    extConfig?: {
      tlogRsaSecret?: string(name='TlogRsaSecret'),
    }(name='ExtConfig'),
  }(name='AppSecurityInfo'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model QueryAppSecurityInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAppSecurityInfoResponseBody(name='body'),
}

/**
 * @summary 查询应用对应的安全字段
 *
 * @param request QueryAppSecurityInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryAppSecurityInfoResponse
 */
async function queryAppSecurityInfoWithOptions(request: QueryAppSecurityInfoRequest, runtime: Util.RuntimeOptions): QueryAppSecurityInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAppSecurityInfo',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询应用对应的安全字段
 *
 * @param request QueryAppSecurityInfoRequest
 * @return QueryAppSecurityInfoResponse
 */
async function queryAppSecurityInfo(request: QueryAppSecurityInfoRequest): QueryAppSecurityInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAppSecurityInfoWithOptions(request, runtime);
}

model QueryProductInfoRequest {
  productId?: string(name='ProductId', description='This parameter is required.', example='1234'),
}

model QueryProductInfoResponseBody = {
  productInfo?: {
    encodedIcon?: string(name='EncodedIcon'),
    iconName?: string(name='IconName'),
    industryId?: int32(name='IndustryId', example='1'),
    name?: string(name='Name'),
    readonly?: boolean(name='Readonly', example='false'),
  }(name='ProductInfo'),
  requestId?: string(name='RequestId', example='126D4DDD-05A5-49B1-B18C-39C4A929BFB2'),
}

model QueryProductInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryProductInfoResponseBody(name='body'),
}

/**
 * @param request QueryProductInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryProductInfoResponse
 */
async function queryProductInfoWithOptions(request: QueryProductInfoRequest, runtime: Util.RuntimeOptions): QueryProductInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryProductInfo',
    version = '2017-08-25',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request QueryProductInfoRequest
 * @return QueryProductInfoResponse
 */
async function queryProductInfo(request: QueryProductInfoRequest): QueryProductInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryProductInfoWithOptions(request, runtime);
}

